import request from '@/config/axios'

// 膳食信息 VO
export interface FoodVO {
  id: number // 主键
  foodname: string // 膳食名称
  foodtype: string // 膳食类别
  foodlabel: string // 膳食标签
  foodprice: number // 膳食价格
  isMuslim: string // 是否清真
  supplyDate: number // 供应星期
  supplyType: number // 供应类型 
  foodpic: string // 图片
}

// 膳食信息 API
export const FoodApi = {
  // 查询膳食信息分页
  getFoodPage: async (params: any) => {
    return await request.get({ url: `/yyzx/food/page`, params })
  },

  // 查询膳食信息详情
  getFood: async (id: number) => {
    return await request.get({ url: `/yyzx/food/get?id=` + id })
  },

  // 新增膳食信息
  createFood: async (data: FoodVO) => {
    return await request.post({ url: `/yyzx/food/create`, data })
  },

  // 修改膳食信息
  updateFood: async (data: FoodVO) => {
    return await request.put({ url: `/yyzx/food/update`, data })
  },

  // 删除膳食信息
  deleteFood: async (id: number) => {
    return await request.delete({ url: `/yyzx/food/delete?id=` + id })
  },

  // 导出膳食信息 Excel
  exportFood: async (params) => {
    return await request.download({ url: `/yyzx/food/export-excel`, params })
  },
}